package com.personnel.controller;

import com.personnel.common.Result;
import com.personnel.pojo.Staff;
import com.personnel.service.LoginService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * 登录控制层
 *
 *@author yuepeng
 * @since 2021-12-28 13:55:41
 * @version 1.0
 */


@RestController
public class LoginController {

    /**
     * 服务对象
     */
    @Resource
    private LoginService loginService;

    @PostMapping(value = "/login")
    public Result login(@RequestBody Staff staff, HttpSession session){
        return loginService.login(staff, session);
    }

    @PostMapping(value = "/loginByPhone")
    public Result loginByPhone(@RequestBody Staff staff, HttpSession session){
        return loginService.loginByPhone(staff, session);
    }
}
